package merlion.scm.rmpm.session;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.ejb.Local;
import merlion.scm.rmpm.entity.GoodsReceipt;
import merlion.scm.rmpm.entity.GoodsReceiptRating;
import merlion.scm.rmpm.entity.PurchasePlan;
import merlion.scm.rmpm.entity.RawMaterial;
import merlion.scm.rmpm.entity.RawMaterialItemLine;
import merlion.scm.rmpm.entity.RawMaterialPurchaseOrder;
import merlion.scm.rmpm.entity.RawMaterialSalesOrder;
import merlion.scm.rmpm.entity.Supplier;
import merlion.scm.rmpm.pojo.RankingRow;
import merlion.scm.rmpm.pojo.SupplierListRow;



@Local
public interface RawMaterialPurchaseSessionBeanLocal {
    
    public List<Supplier> getAllSupplier();
    public RawMaterialItemLine calculateLine(RawMaterialItemLine rmil);
    public RawMaterialPurchaseOrder calculatePurchaseOrder(RawMaterialPurchaseOrder rmpo);
    public RawMaterialPurchaseOrder savePurchaseOrder(RawMaterialPurchaseOrder rmpo);
    public List<RawMaterialPurchaseOrder> getAllPurchaseOrder();
    public String generatePurchaseOrderNumber();
    public RawMaterialSalesOrder saveSalesOrder(RawMaterialSalesOrder rmso);
    public List<RawMaterialPurchaseOrder> getAllPurchaseOrderWOSalesOrder();
    public List<RawMaterialSalesOrder> getAllSalesOrder();
    public List<RawMaterial> getAllRawMaterial();
    public RawMaterial getRawMaterialbyName(String name);
    public Supplier saveSupplier(Supplier s);
    public String generateSupplierId();
    public Supplier getSupplierById(Long id);
    public List<GoodsReceipt> getUnratedGoodsReceiptBySupplier(Supplier supplier);
    public List<GoodsReceipt> getRatedGoodsReceiptBySupplier(Supplier supplier);
    public GoodsReceiptRating saveGoodsReceiptRating(GoodsReceiptRating rating);
    public Double calculateSupplierRating(Supplier supplier);
    public Boolean matchSalesOrderItems(RawMaterialSalesOrder rmso);
    public Boolean matchSalesOrderTotal(RawMaterialSalesOrder rmso);
    public Boolean matchSalesOrderCurrency(RawMaterialSalesOrder rmso);
    public ArrayList<RankingRow> rankSupplier (RawMaterial rm, String criteria);
    public PurchasePlan createPurchasePlan(Collection<SupplierListRow> supplierList, Boolean currency, Boolean urgent);
    public PurchasePlan savePurchasePlan(PurchasePlan pp);
    public Collection<PurchasePlan> getAllPurchasePlan();
    
        
}
